local shiquan = fk.CreateSkill{
  name = "lingling__shiquan",
  tags = { Skill.Limited },
}

Fk:loadTranslationTable{
  ["lingling__shiquan"] = "释权",
  [":lingling__shiquan"] = "限定技，出牌阶段，你可以获得一名其他角色所有手牌，然后交给其等量的牌。",

  ["#lingling__shiquan"] = "释权：获得一名其他角色所有手牌，交给其等量的牌",
  ["#lingling__shiquan-give"] = "释权：请交给 %dest %arg张牌",

  ["$lingling__shiquan1"] = "荒石没落襄阳甲，蒿草当年始皇兵。",
  ["$lingling__shiquan2"] = "望与诸位求仁得仁。",
}

shiquan:addEffect("active", {
  anim_type = "control",
  prompt = "#lingling__shiquan",
  card_num = 0,
  target_num = 1,
  can_use = function(self, player)
    return player:usedSkillTimes(shiquan.name, Player.HistoryGame) == 0
  end,
  card_filter = Util.FalseFunc,
  target_filter = function (self, player, to_select, selected)
    return #selected == 0 and to_select ~= player and not to_select:isKongcheng()
  end,
  on_use = function(self, room, effect)
    local player = effect.from
    local target = effect.tos[1]
    local n = target:getHandcardNum()
    room:moveCardTo(target:getCardIds("h"), Card.PlayerHand, player, fk.ReasonPrey, shiquan.name, nil, false, player)
    if player.dead or target.dead or player:isNude() then return end
    local cards = room:askToCards(player, {
      min_num = n,
      max_num = n,
      include_equip = true,
      skill_name = shiquan.name,
      prompt = "#lingling__shiquan-give::"..target.id..":"..n,
      cancelable = false,
    })
    room:moveCardTo(cards, Card.PlayerHand, target, fk.ReasonGive, shiquan.name, nil, false, player)
  end,
})

return shiquan
